import os
import time

class Logs:

    def __init__(self):
        dateline = int(time.time())
        self.logdate = time.strftime('%Y%m%d',time.localtime(dateline))
        self.path = os.path.split(os.path.realpath(__file__))[0]
        self.logtime = time.strftime('[%Y-%m-%d %H:%M:%S]:', \
            time.localtime(dateline))
        pass
    def logwrite(self, loginfo, log_type = 'error'):
        print self.logtime + loginfo + "\t"
        # files = self.path + '/log/' + log_type + '-' + self.logdate + '.log'
        # with open(files, 'a') as logfile:
        #     logfile.write(self.logtime)
        #     logfile.write("\t")
        #     logfile.write(loginfo)
        #     logfile.write("\n")
        #     logfile.close()
        # pass